#ifndef LIBCO_HOOK_H
#define LIBCO_HOOK_H

#include "dlfcn.h"
#include "monitor.hpp"

namespace libco {

void set_hook_enable();

}

extern "C" {

/// sleep
typedef unsigned int (*sleep_func_t)(unsigned int);
extern sleep_func_t sleep_f;
    
/// usleep
typedef int (*usleep_func_t)(unsigned int);
extern usleep_func_t usleep_f;

/// nanosleep
typedef int (*nanosleep_func_t)(const struct timespec*, struct timespec*);
extern nanosleep_func_t nanosleep_f;

//read
typedef ssize_t (*read_fun)(int fd, void *buf, size_t count);
extern read_fun read_f;

//write
typedef ssize_t (*write_fun)(int fd, const void *buf, size_t count);
extern write_fun write_f;

}

#endif